// api/member-card.js
import request from '@/utils/request';

export const memberCardApi = {
  // 获取卡券信息
  getCardInfo(cardId) {
    return request({
      url: '/web/wx_card/info',
      method: 'GET',
      data: { cardId }
    });
  },

  // 激活会员卡
  activateCard(data) {
    return request({
      url: '/api/member-card/activate',
      method: 'POST',
      data
    });
  },

  // 获取微信卡券参数
  getWechatCardParams(data) {
    return request({
      url: '/api/wechat/card-params',
      method: 'POST',
      data
    });
  },

  // 提交表单数据
  submitFormData(data) {
    return request({
      url: '/api/member-card/submit-form',
      method: 'POST',
      data
    });
  }
};

// api/wechat.js
export const wechatApi = {
  // 获取微信配置
  getJsConfig(data) {
    return request({
      url: '/api/wechat/js-config',
      method: 'POST',
      data
    });
  },

  // 获取微信用户信息
  getUserInfo() {
    return request({
      url: '/api/wechat/user-info',
      method: 'GET'
    });
  }
};